﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MessageHandling
{
    public delegate void ReadMessageAsyncCallback(ReadMessageEventArgs e);

    //**********************************************
    //This is the argument passed to the above delegate
    //**********************************************
    public class ReadMessageEventArgs : EventArgs
    {
        public ReadMessageEventArgs()
        {
            IsKeepAliveMessage = true;
        }
        public ReadMessageEventArgs(byte[] msg)
        {
            Message = msg;
            Error = null;
        }
        public ReadMessageEventArgs(Exception err)
        {
            Error = err;
            Message = null;
        }
        public readonly Exception Error;
        public readonly byte[] Message;
        public readonly bool IsKeepAliveMessage = false;
    }

 
}
